#!/usr/bin/env ruby

require 'rubygems'
require 'bundler/setup'
Bundler.require :default
require 'em-synchrony/activerecord'
require 'yaml'
require 'pathname'

Dir[File.expand_path('../app/models/*.rb' ,__FILE__)].each { |f| require f }
require_relative './app/api'

ActiveRecord::Base.establish_connection YAML.load_file('db/config.yml')[Goliath.env.to_s]

class Server < Goliath::API
  def response(env)
    Api.call(env)
  end
end